package it.tcm.TeacherClassMate.action;


import java.util.List;
import it.tcm.TeacherClassMate.beans.OrderMainBean;
import it.tcm.TeacherClassMate.beans.SessionUser;
import it.tcm.TeacherClassMate.facade.OrderMainManageBase;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;


public class UserVerificheAction extends Action {

	// --------------------------------------------------------- Instance Variables

	// --------------------------------------------------------- Methods


	private Logger logger = Logger.getLogger(this.getClass().getName());
	
	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 * 
	 */

	public ActionForward execute(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response) 
	{		
		 logger.info("USER VERIFICHE ACTION");
		 SessionUser sessionUser = (SessionUser) request.getSession().getAttribute("sessionUser");
		 OrderMainManageBase ommb = new OrderMainManageBase();
		 List<OrderMainBean> oList = ommb.getOrderMainBeanByUserid(sessionUser.getUserId());
		 request.setAttribute("resultList", oList);
		 return mapping.findForward("userverifiche"); 		 
	}
	


	
}